function cancelPublish(goodsId,areaCode) {
    if (confirm("确认下架该商品嘛？")) {
        jQuery.ajax({
            type:"post",
            url:appServer + "/goods/cancel/publish.json",
            dataType:"json",
            data:{"goodsId":goodsId,"areaCode":areaCode},
            success:function(message){
                if (message.code == 0) {
                    alert(message.msg);
                    window.location.reload();
                } else {
                    alert(message.msg);
                }
            },
            error:function(xhr, message, e){

            }
        });
    }
}

function getPlateList(goodsId,areaCode) {
    window.open(appServer+'/area/retailArea/getPlateList.htm?goodsId='+goodsId+"&areaCode="+areaCode, 'newwindow', 'height=400, width=1000, top=20,left=150, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no').focus();
}

function rePublish(goodsId,areaCode) {
    if (confirm("确认重新上架该商品嘛？")) {
        jQuery.ajax({
            type:"post",
            url:appServer + "/goods/rePublish.json",
            dataType:"json",
            data:{"goodsId":goodsId,"areaCode":areaCode},
            success:function(message){
                if (message.code == 0) {
                    alert(message.msg);
                    window.location.reload();
                } else {
                    alert(message.msg);
                }
            },
            error:function(xhr, message, e){

            }
        });
    }
}

function hotGoods(areaCode,goodsId,type) {
    var content = "";
    if (type == '1'){
        content = "确定把该商品置为爆款嘛？"
    }else if (type == "0"){
        content = "确定取消爆款嘛？"
    }
    if (confirm(content)) {
        jQuery.ajax({
            type:"post",
            url:appServer + "/area/hotGoods.json",
            dataType:"json",
            data:{"goodsId":goodsId,"areaCode":areaCode,"type":type},
            success:function(message){
                if (message.code == 0) {
                    alert(message.msg);
                    window.location.reload();
                } else {
                    alert(message.msg);
                }
            },
            error:function(xhr, message, e){

            }
        });
    }
}